﻿///////////////////////////////////////////////////////////////
// This is generated code. 
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 3.1
// Code is generated on: 2012年10月10日 8:11:49
// Code is generated using templates: SD.TemplateBindings.SharedTemplates.NET20
// Templates vendor: Solutions Design.
// Templates version: 
//////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using NetDon.eBoss.Data.HelperClasses;

using NetDon.eBoss.Data.EntityClasses;
using NetDon.eBoss.Data.RelationClasses;
using NetDon.eBoss.Data.DaoClasses;
using NetDon.eBoss.Data.CollectionClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;

namespace NetDon.eBoss.Data.FactoryClasses
{
	// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
	// __LLBLGENPRO_USER_CODE_REGION_END
	/// <summary>general base class for the generated factories</summary>
	[Serializable]
	public partial class EntityFactoryBase : EntityFactoryCore
	{
		private readonly NetDon.eBoss.Data.EntityType _typeOfEntity;
		
		/// <summary>CTor</summary>
		/// <param name="entityName">Name of the entity.</param>
		/// <param name="typeOfEntity">The type of entity.</param>
		public EntityFactoryBase(string entityName, NetDon.eBoss.Data.EntityType typeOfEntity) : base(entityName)
		{
			_typeOfEntity = typeOfEntity;
		}

		/// <summary>Creates a new entity instance using the GeneralEntityFactory in the generated code, using the passed in entitytype value</summary>
		/// <param name="entityTypeValue">The entity type value of the entity to create an instance for.</param>
		/// <returns>new IEntity instance</returns>
		public override IEntity CreateEntityFromEntityTypeValue(int entityTypeValue)
		{
			return GeneralEntityFactory.Create((NetDon.eBoss.Data.EntityType)entityTypeValue);
		}
		
		/// <summary>Creates, using the generated EntityFieldsFactory, the IEntityFields object for the entity to create. </summary>
		/// <returns>Empty IEntityFields object.</returns>
		public override IEntityFields CreateFields()
		{
			return EntityFieldsFactory.CreateEntityFieldsObject(_typeOfEntity);
		}

		/// <summary>Creates the relations collection to the entity to join all targets so this entity can be fetched. </summary>
		/// <param name="objectAlias">The object alias to use for the elements in the relations.</param>
		/// <returns>null if the entity isn't in a hierarchy of type TargetPerEntity, otherwise the relations collection needed to join all targets together to fetch all subtypes of this entity and this entity itself</returns>
		public override IRelationCollection CreateHierarchyRelations(string objectAlias) 
		{
			return InheritanceInfoProviderSingleton.GetInstance().GetHierarchyRelations(ForEntityName, objectAlias);
		}

		/// <summary>This method retrieves, using the InheritanceInfoprovider, the factory for the entity represented by the values passed in.</summary>
		/// <param name="fieldValues">Field values read from the db, to determine which factory to return, based on the field values passed in.</param>
		/// <param name="entityFieldStartIndexesPerEntity">indexes into values where per entity type their own fields start.</param>
		/// <returns>the factory for the entity which is represented by the values passed in.</returns>
		public override IEntityFactory GetEntityFactory(object[] fieldValues, Dictionary<string, int> entityFieldStartIndexesPerEntity)
		{
			return (IEntityFactory)InheritanceInfoProviderSingleton.GetInstance().GetEntityFactory(ForEntityName, fieldValues, entityFieldStartIndexesPerEntity) ?? this;
		}
						
		/// <summary>Creates a new entity collection for the entity of this factory.</summary>
		/// <returns>ready to use new entity collection, typed.</returns>
		public override IEntityCollection CreateEntityCollection()
		{
			return GeneralEntityCollectionFactory.Create(_typeOfEntity);
		}
	}
	
	/// <summary>Factory to create new, empty BrandsettingEntity objects.</summary>
	[Serializable]
	public partial class BrandsettingEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public BrandsettingEntityFactory() : base("BrandsettingEntity", NetDon.eBoss.Data.EntityType.BrandsettingEntity) { }

		/// <summary>Creates a new, empty BrandsettingEntity object.</summary>
		/// <returns>A new, empty BrandsettingEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new BrandsettingEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewBrandsetting
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty ConfigurationEntity objects.</summary>
	[Serializable]
	public partial class ConfigurationEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public ConfigurationEntityFactory() : base("ConfigurationEntity", NetDon.eBoss.Data.EntityType.ConfigurationEntity) { }

		/// <summary>Creates a new, empty ConfigurationEntity object.</summary>
		/// <returns>A new, empty ConfigurationEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new ConfigurationEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewConfiguration
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty DictionaryEntity objects.</summary>
	[Serializable]
	public partial class DictionaryEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public DictionaryEntityFactory() : base("DictionaryEntity", NetDon.eBoss.Data.EntityType.DictionaryEntity) { }

		/// <summary>Creates a new, empty DictionaryEntity object.</summary>
		/// <returns>A new, empty DictionaryEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new DictionaryEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewDictionary
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty DictionarycategoryEntity objects.</summary>
	[Serializable]
	public partial class DictionarycategoryEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public DictionarycategoryEntityFactory() : base("DictionarycategoryEntity", NetDon.eBoss.Data.EntityType.DictionarycategoryEntity) { }

		/// <summary>Creates a new, empty DictionarycategoryEntity object.</summary>
		/// <returns>A new, empty DictionarycategoryEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new DictionarycategoryEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewDictionarycategory
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty FunctionEntity objects.</summary>
	[Serializable]
	public partial class FunctionEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public FunctionEntityFactory() : base("FunctionEntity", NetDon.eBoss.Data.EntityType.FunctionEntity) { }

		/// <summary>Creates a new, empty FunctionEntity object.</summary>
		/// <returns>A new, empty FunctionEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new FunctionEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewFunction
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty HtmltoolaccountEntity objects.</summary>
	[Serializable]
	public partial class HtmltoolaccountEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public HtmltoolaccountEntityFactory() : base("HtmltoolaccountEntity", NetDon.eBoss.Data.EntityType.HtmltoolaccountEntity) { }

		/// <summary>Creates a new, empty HtmltoolaccountEntity object.</summary>
		/// <returns>A new, empty HtmltoolaccountEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new HtmltoolaccountEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewHtmltoolaccount
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty HtmltoolaccounttemplateEntity objects.</summary>
	[Serializable]
	public partial class HtmltoolaccounttemplateEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public HtmltoolaccounttemplateEntityFactory() : base("HtmltoolaccounttemplateEntity", NetDon.eBoss.Data.EntityType.HtmltoolaccounttemplateEntity) { }

		/// <summary>Creates a new, empty HtmltoolaccounttemplateEntity object.</summary>
		/// <returns>A new, empty HtmltoolaccounttemplateEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new HtmltoolaccounttemplateEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewHtmltoolaccounttemplate
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty HtmltoolcategoryruleEntity objects.</summary>
	[Serializable]
	public partial class HtmltoolcategoryruleEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public HtmltoolcategoryruleEntityFactory() : base("HtmltoolcategoryruleEntity", NetDon.eBoss.Data.EntityType.HtmltoolcategoryruleEntity) { }

		/// <summary>Creates a new, empty HtmltoolcategoryruleEntity object.</summary>
		/// <returns>A new, empty HtmltoolcategoryruleEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new HtmltoolcategoryruleEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewHtmltoolcategoryrule
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty HtmltoolcolorEntity objects.</summary>
	[Serializable]
	public partial class HtmltoolcolorEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public HtmltoolcolorEntityFactory() : base("HtmltoolcolorEntity", NetDon.eBoss.Data.EntityType.HtmltoolcolorEntity) { }

		/// <summary>Creates a new, empty HtmltoolcolorEntity object.</summary>
		/// <returns>A new, empty HtmltoolcolorEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new HtmltoolcolorEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewHtmltoolcolor
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty HtmltoolstyleEntity objects.</summary>
	[Serializable]
	public partial class HtmltoolstyleEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public HtmltoolstyleEntityFactory() : base("HtmltoolstyleEntity", NetDon.eBoss.Data.EntityType.HtmltoolstyleEntity) { }

		/// <summary>Creates a new, empty HtmltoolstyleEntity object.</summary>
		/// <returns>A new, empty HtmltoolstyleEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new HtmltoolstyleEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewHtmltoolstyle
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty HtmltooltrademarksettingEntity objects.</summary>
	[Serializable]
	public partial class HtmltooltrademarksettingEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public HtmltooltrademarksettingEntityFactory() : base("HtmltooltrademarksettingEntity", NetDon.eBoss.Data.EntityType.HtmltooltrademarksettingEntity) { }

		/// <summary>Creates a new, empty HtmltooltrademarksettingEntity object.</summary>
		/// <returns>A new, empty HtmltooltrademarksettingEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new HtmltooltrademarksettingEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewHtmltooltrademarksetting
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty HtmltoolvocabularyEntity objects.</summary>
	[Serializable]
	public partial class HtmltoolvocabularyEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public HtmltoolvocabularyEntityFactory() : base("HtmltoolvocabularyEntity", NetDon.eBoss.Data.EntityType.HtmltoolvocabularyEntity) { }

		/// <summary>Creates a new, empty HtmltoolvocabularyEntity object.</summary>
		/// <returns>A new, empty HtmltoolvocabularyEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new HtmltoolvocabularyEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewHtmltoolvocabulary
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty ProduccategoryattributeEntity objects.</summary>
	[Serializable]
	public partial class ProduccategoryattributeEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public ProduccategoryattributeEntityFactory() : base("ProduccategoryattributeEntity", NetDon.eBoss.Data.EntityType.ProduccategoryattributeEntity) { }

		/// <summary>Creates a new, empty ProduccategoryattributeEntity object.</summary>
		/// <returns>A new, empty ProduccategoryattributeEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new ProduccategoryattributeEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewProduccategoryattribute
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty ProductEntity objects.</summary>
	[Serializable]
	public partial class ProductEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public ProductEntityFactory() : base("ProductEntity", NetDon.eBoss.Data.EntityType.ProductEntity) { }

		/// <summary>Creates a new, empty ProductEntity object.</summary>
		/// <returns>A new, empty ProductEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new ProductEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewProduct
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty ProductcategoryEntity objects.</summary>
	[Serializable]
	public partial class ProductcategoryEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public ProductcategoryEntityFactory() : base("ProductcategoryEntity", NetDon.eBoss.Data.EntityType.ProductcategoryEntity) { }

		/// <summary>Creates a new, empty ProductcategoryEntity object.</summary>
		/// <returns>A new, empty ProductcategoryEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new ProductcategoryEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewProductcategory
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty ProductgroupEntity objects.</summary>
	[Serializable]
	public partial class ProductgroupEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public ProductgroupEntityFactory() : base("ProductgroupEntity", NetDon.eBoss.Data.EntityType.ProductgroupEntity) { }

		/// <summary>Creates a new, empty ProductgroupEntity object.</summary>
		/// <returns>A new, empty ProductgroupEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new ProductgroupEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewProductgroup
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty ProductsummaryEntity objects.</summary>
	[Serializable]
	public partial class ProductsummaryEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public ProductsummaryEntityFactory() : base("ProductsummaryEntity", NetDon.eBoss.Data.EntityType.ProductsummaryEntity) { }

		/// <summary>Creates a new, empty ProductsummaryEntity object.</summary>
		/// <returns>A new, empty ProductsummaryEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new ProductsummaryEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewProductsummary
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty RoleEntity objects.</summary>
	[Serializable]
	public partial class RoleEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public RoleEntityFactory() : base("RoleEntity", NetDon.eBoss.Data.EntityType.RoleEntity) { }

		/// <summary>Creates a new, empty RoleEntity object.</summary>
		/// <returns>A new, empty RoleEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new RoleEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewRole
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty RolefunctionEntity objects.</summary>
	[Serializable]
	public partial class RolefunctionEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public RolefunctionEntityFactory() : base("RolefunctionEntity", NetDon.eBoss.Data.EntityType.RolefunctionEntity) { }

		/// <summary>Creates a new, empty RolefunctionEntity object.</summary>
		/// <returns>A new, empty RolefunctionEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new RolefunctionEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewRolefunction
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty SizesettingEntity objects.</summary>
	[Serializable]
	public partial class SizesettingEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public SizesettingEntityFactory() : base("SizesettingEntity", NetDon.eBoss.Data.EntityType.SizesettingEntity) { }

		/// <summary>Creates a new, empty SizesettingEntity object.</summary>
		/// <returns>A new, empty SizesettingEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new SizesettingEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewSizesetting
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty StoreEntity objects.</summary>
	[Serializable]
	public partial class StoreEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public StoreEntityFactory() : base("StoreEntity", NetDon.eBoss.Data.EntityType.StoreEntity) { }

		/// <summary>Creates a new, empty StoreEntity object.</summary>
		/// <returns>A new, empty StoreEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new StoreEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewStore
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty StorecategoryEntity objects.</summary>
	[Serializable]
	public partial class StorecategoryEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public StorecategoryEntityFactory() : base("StorecategoryEntity", NetDon.eBoss.Data.EntityType.StorecategoryEntity) { }

		/// <summary>Creates a new, empty StorecategoryEntity object.</summary>
		/// <returns>A new, empty StorecategoryEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new StorecategoryEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewStorecategory
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty TemplateEntity objects.</summary>
	[Serializable]
	public partial class TemplateEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public TemplateEntityFactory() : base("TemplateEntity", NetDon.eBoss.Data.EntityType.TemplateEntity) { }

		/// <summary>Creates a new, empty TemplateEntity object.</summary>
		/// <returns>A new, empty TemplateEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new TemplateEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewTemplate
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty TitlesettingEntity objects.</summary>
	[Serializable]
	public partial class TitlesettingEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public TitlesettingEntityFactory() : base("TitlesettingEntity", NetDon.eBoss.Data.EntityType.TitlesettingEntity) { }

		/// <summary>Creates a new, empty TitlesettingEntity object.</summary>
		/// <returns>A new, empty TitlesettingEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new TitlesettingEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewTitlesetting
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty UserEntity objects.</summary>
	[Serializable]
	public partial class UserEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public UserEntityFactory() : base("UserEntity", NetDon.eBoss.Data.EntityType.UserEntity) { }

		/// <summary>Creates a new, empty UserEntity object.</summary>
		/// <returns>A new, empty UserEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new UserEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewUser
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty UserroleEntity objects.</summary>
	[Serializable]
	public partial class UserroleEntityFactory : EntityFactoryBase {
		/// <summary>CTor</summary>
		public UserroleEntityFactory() : base("UserroleEntity", NetDon.eBoss.Data.EntityType.UserroleEntity) { }

		/// <summary>Creates a new, empty UserroleEntity object.</summary>
		/// <returns>A new, empty UserroleEntity object.</returns>
		public override IEntity Create() {
			IEntity toReturn = new UserroleEntity();
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewUserrole
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}


		#region Included Code

		#endregion
	}

	/// <summary>Factory to create new entity collection objects</summary>
	[Serializable]
	public partial class GeneralEntityCollectionFactory
	{
		/// <summary>Creates a new entity collection</summary>
		/// <param name="typeToUse">The entity type to create the collection for.</param>
		/// <returns>A new entity collection object.</returns>
		public static IEntityCollection Create(NetDon.eBoss.Data.EntityType typeToUse)
		{
			switch(typeToUse)
			{
				case NetDon.eBoss.Data.EntityType.BrandsettingEntity:
					return new BrandsettingCollection();
				case NetDon.eBoss.Data.EntityType.ConfigurationEntity:
					return new ConfigurationCollection();
				case NetDon.eBoss.Data.EntityType.DictionaryEntity:
					return new DictionaryCollection();
				case NetDon.eBoss.Data.EntityType.DictionarycategoryEntity:
					return new DictionarycategoryCollection();
				case NetDon.eBoss.Data.EntityType.FunctionEntity:
					return new FunctionCollection();
				case NetDon.eBoss.Data.EntityType.HtmltoolaccountEntity:
					return new HtmltoolaccountCollection();
				case NetDon.eBoss.Data.EntityType.HtmltoolaccounttemplateEntity:
					return new HtmltoolaccounttemplateCollection();
				case NetDon.eBoss.Data.EntityType.HtmltoolcategoryruleEntity:
					return new HtmltoolcategoryruleCollection();
				case NetDon.eBoss.Data.EntityType.HtmltoolcolorEntity:
					return new HtmltoolcolorCollection();
				case NetDon.eBoss.Data.EntityType.HtmltoolstyleEntity:
					return new HtmltoolstyleCollection();
				case NetDon.eBoss.Data.EntityType.HtmltooltrademarksettingEntity:
					return new HtmltooltrademarksettingCollection();
				case NetDon.eBoss.Data.EntityType.HtmltoolvocabularyEntity:
					return new HtmltoolvocabularyCollection();
				case NetDon.eBoss.Data.EntityType.ProduccategoryattributeEntity:
					return new ProduccategoryattributeCollection();
				case NetDon.eBoss.Data.EntityType.ProductEntity:
					return new ProductCollection();
				case NetDon.eBoss.Data.EntityType.ProductcategoryEntity:
					return new ProductcategoryCollection();
				case NetDon.eBoss.Data.EntityType.ProductgroupEntity:
					return new ProductgroupCollection();
				case NetDon.eBoss.Data.EntityType.ProductsummaryEntity:
					return new ProductsummaryCollection();
				case NetDon.eBoss.Data.EntityType.RoleEntity:
					return new RoleCollection();
				case NetDon.eBoss.Data.EntityType.RolefunctionEntity:
					return new RolefunctionCollection();
				case NetDon.eBoss.Data.EntityType.SizesettingEntity:
					return new SizesettingCollection();
				case NetDon.eBoss.Data.EntityType.StoreEntity:
					return new StoreCollection();
				case NetDon.eBoss.Data.EntityType.StorecategoryEntity:
					return new StorecategoryCollection();
				case NetDon.eBoss.Data.EntityType.TemplateEntity:
					return new TemplateCollection();
				case NetDon.eBoss.Data.EntityType.TitlesettingEntity:
					return new TitlesettingCollection();
				case NetDon.eBoss.Data.EntityType.UserEntity:
					return new UserCollection();
				case NetDon.eBoss.Data.EntityType.UserroleEntity:
					return new UserroleCollection();
				default:
					return null;
			}
		}		
	}
	
	/// <summary>Factory to create new, empty Entity objects based on the entity type specified. Uses entity specific factory objects</summary>
	[Serializable]
	public partial class GeneralEntityFactory
	{
		/// <summary>Creates a new, empty Entity object of the type specified</summary>
		/// <param name="entityTypeToCreate">The entity type to create.</param>
		/// <returns>A new, empty Entity object.</returns>
		public static IEntity Create(NetDon.eBoss.Data.EntityType entityTypeToCreate)
		{
			IEntityFactory factoryToUse = null;
			switch(entityTypeToCreate)
			{
				case NetDon.eBoss.Data.EntityType.BrandsettingEntity:
					factoryToUse = new BrandsettingEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.ConfigurationEntity:
					factoryToUse = new ConfigurationEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.DictionaryEntity:
					factoryToUse = new DictionaryEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.DictionarycategoryEntity:
					factoryToUse = new DictionarycategoryEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.FunctionEntity:
					factoryToUse = new FunctionEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.HtmltoolaccountEntity:
					factoryToUse = new HtmltoolaccountEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.HtmltoolaccounttemplateEntity:
					factoryToUse = new HtmltoolaccounttemplateEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.HtmltoolcategoryruleEntity:
					factoryToUse = new HtmltoolcategoryruleEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.HtmltoolcolorEntity:
					factoryToUse = new HtmltoolcolorEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.HtmltoolstyleEntity:
					factoryToUse = new HtmltoolstyleEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.HtmltooltrademarksettingEntity:
					factoryToUse = new HtmltooltrademarksettingEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.HtmltoolvocabularyEntity:
					factoryToUse = new HtmltoolvocabularyEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.ProduccategoryattributeEntity:
					factoryToUse = new ProduccategoryattributeEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.ProductEntity:
					factoryToUse = new ProductEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.ProductcategoryEntity:
					factoryToUse = new ProductcategoryEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.ProductgroupEntity:
					factoryToUse = new ProductgroupEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.ProductsummaryEntity:
					factoryToUse = new ProductsummaryEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.RoleEntity:
					factoryToUse = new RoleEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.RolefunctionEntity:
					factoryToUse = new RolefunctionEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.SizesettingEntity:
					factoryToUse = new SizesettingEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.StoreEntity:
					factoryToUse = new StoreEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.StorecategoryEntity:
					factoryToUse = new StorecategoryEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.TemplateEntity:
					factoryToUse = new TemplateEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.TitlesettingEntity:
					factoryToUse = new TitlesettingEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.UserEntity:
					factoryToUse = new UserEntityFactory();
					break;
				case NetDon.eBoss.Data.EntityType.UserroleEntity:
					factoryToUse = new UserroleEntityFactory();
					break;
			}
			IEntity toReturn = null;
			if(factoryToUse != null)
			{
				toReturn = factoryToUse.Create();
			}
			return toReturn;
		}		
	}
	
	/// <summary>Class which is used to obtain the entity factory based on the .NET type of the entity. </summary>
	[Serializable]
	public static class EntityFactoryFactory
	{
#if CF
		/// <summary>Gets the factory of the entity with the NetDon.eBoss.Data.EntityType specified</summary>
		/// <param name="typeOfEntity">The type of entity.</param>
		/// <returns>factory to use or null if not found</returns>
		public static IEntityFactory GetFactory(NetDon.eBoss.Data.EntityType typeOfEntity)
		{
			return GeneralEntityFactory.Create(typeOfEntity).GetEntityFactory();
		}
#else
		private static readonly Dictionary<Type, IEntityFactory> _factoryPerType = new Dictionary<Type, IEntityFactory>();

		/// <summary>Initializes the <see cref="EntityFactoryFactory"/> class.</summary>
		static EntityFactoryFactory()
		{
			Array entityTypeValues = Enum.GetValues(typeof(NetDon.eBoss.Data.EntityType));
			foreach(int entityTypeValue in entityTypeValues)
			{
				IEntity dummy = GeneralEntityFactory.Create((NetDon.eBoss.Data.EntityType)entityTypeValue);
				_factoryPerType.Add(dummy.GetType(), dummy.GetEntityFactory());
			}
		}

		/// <summary>Gets the factory of the entity with the .NET type specified</summary>
		/// <param name="typeOfEntity">The type of entity.</param>
		/// <returns>factory to use or null if not found</returns>
		public static IEntityFactory GetFactory(Type typeOfEntity)
		{
			IEntityFactory toReturn = null;
			_factoryPerType.TryGetValue(typeOfEntity, out toReturn);
			return toReturn;
		}

		/// <summary>Gets the factory of the entity with the NetDon.eBoss.Data.EntityType specified</summary>
		/// <param name="typeOfEntity">The type of entity.</param>
		/// <returns>factory to use or null if not found</returns>
		public static IEntityFactory GetFactory(NetDon.eBoss.Data.EntityType typeOfEntity)
		{
			return GetFactory(GeneralEntityFactory.Create(typeOfEntity).GetType());
		}
#endif
	}
	
	/// <summary>Element creator for creating project elements from somewhere else, like inside Linq providers.</summary>
	public class ElementCreator : ElementCreatorBase, IElementCreator
	{
		/// <summary>Gets the factory of the Entity type with the NetDon.eBoss.Data.EntityType value passed in</summary>
		/// <param name="entityTypeValue">The entity type value.</param>
		/// <returns>the entity factory of the entity type or null if not found</returns>
		public IEntityFactory GetFactory(int entityTypeValue)
		{
			return (IEntityFactory)this.GetFactoryImpl(entityTypeValue);
		}

		/// <summary>Gets the factory of the Entity type with the .NET type passed in</summary>
		/// <param name="typeOfEntity">The type of entity.</param>
		/// <returns>the entity factory of the entity type or null if not found</returns>
		public IEntityFactory GetFactory(Type typeOfEntity)
		{
			return (IEntityFactory)this.GetFactoryImpl(typeOfEntity);
		}

		/// <summary>Creates a new resultset fields object with the number of field slots reserved as specified</summary>
		/// <param name="numberOfFields">The number of fields.</param>
		/// <returns>ready to use resultsetfields object</returns>
		public IEntityFields CreateResultsetFields(int numberOfFields)
		{
			return new ResultsetFields(numberOfFields);
		}
		
		/// <summary>Gets an instance of the TypedListDAO class to execute dynamic lists and projections.</summary>
		/// <returns>ready to use typedlistDAO</returns>
		public IDao GetTypedListDao()
		{
			return new TypedListDAO();
		}
		
		/// <summary>Creates a new dynamic relation instance</summary>
		/// <param name="leftOperand">The left operand.</param>
		/// <returns>ready to use dynamic relation</returns>
		public override IDynamicRelation CreateDynamicRelation(DerivedTableDefinition leftOperand)
		{
			return new DynamicRelation(leftOperand);
		}

		/// <summary>Creates a new dynamic relation instance</summary>
		/// <param name="leftOperand">The left operand.</param>
		/// <param name="joinType">Type of the join. If None is specified, Inner is assumed.</param>
		/// <param name="rightOperand">The right operand.</param>
		/// <param name="onClause">The on clause for the join.</param>
		/// <returns>ready to use dynamic relation</returns>
		public override IDynamicRelation CreateDynamicRelation(DerivedTableDefinition leftOperand, JoinHint joinType, DerivedTableDefinition rightOperand, IPredicate onClause)
		{
			return new DynamicRelation(leftOperand, joinType, rightOperand, onClause);
		}

		/// <summary>Creates a new dynamic relation instance</summary>
		/// <param name="leftOperand">The left operand.</param>
		/// <param name="joinType">Type of the join. If None is specified, Inner is assumed.</param>
		/// <param name="rightOperandEntityName">Name of the entity, which is used as the right operand.</param>
		/// <param name="aliasRightOperand">The alias of the right operand. If you don't want to / need to alias the right operand (only alias if you have to), specify string.Empty.</param>
		/// <param name="onClause">The on clause for the join.</param>
		/// <returns>ready to use dynamic relation</returns>
		public override IDynamicRelation CreateDynamicRelation(DerivedTableDefinition leftOperand, JoinHint joinType, string rightOperandEntityName, string aliasRightOperand, IPredicate onClause)
		{
			return new DynamicRelation(leftOperand, joinType, (NetDon.eBoss.Data.EntityType)Enum.Parse(typeof(NetDon.eBoss.Data.EntityType), rightOperandEntityName, false), aliasRightOperand, onClause);
		}

		/// <summary>Creates a new dynamic relation instance</summary>
		/// <param name="leftOperandEntityName">Name of the entity which is used as the left operand.</param>
		/// <param name="joinType">Type of the join. If None is specified, Inner is assumed.</param>
		/// <param name="rightOperandEntityName">Name of the entity, which is used as the right operand.</param>
		/// <param name="aliasLeftOperand">The alias of the left operand. If you don't want to / need to alias the right operand (only alias if you have to), specify string.Empty.</param>
		/// <param name="aliasRightOperand">The alias of the right operand. If you don't want to / need to alias the right operand (only alias if you have to), specify string.Empty.</param>
		/// <param name="onClause">The on clause for the join.</param>
		/// <returns>ready to use dynamic relation</returns>
		public override IDynamicRelation CreateDynamicRelation(string leftOperandEntityName, JoinHint joinType, string rightOperandEntityName, string aliasLeftOperand, string aliasRightOperand, IPredicate onClause)
		{
			return new DynamicRelation((NetDon.eBoss.Data.EntityType)Enum.Parse(typeof(NetDon.eBoss.Data.EntityType), leftOperandEntityName, false), joinType, (NetDon.eBoss.Data.EntityType)Enum.Parse(typeof(NetDon.eBoss.Data.EntityType), rightOperandEntityName, false), aliasLeftOperand, aliasRightOperand, onClause);
		}
				
		/// <summary>Obtains the inheritance info provider instance from the singleton </summary>
		/// <returns>The singleton instance of the inheritance info provider</returns>
		public override IInheritanceInfoProvider ObtainInheritanceInfoProviderInstance()
		{
			return InheritanceInfoProviderSingleton.GetInstance();
		}

		/// <summary>Implementation of the routine which gets the factory of the Entity type with the NetDon.eBoss.Data.EntityType value passed in</summary>
		/// <param name="entityTypeValue">The entity type value.</param>
		/// <returns>the entity factory of the entity type or null if not found</returns>
		protected override IEntityFactoryCore GetFactoryImpl(int entityTypeValue)
		{
			return EntityFactoryFactory.GetFactory((NetDon.eBoss.Data.EntityType)entityTypeValue);
		}
#if !CF		
		/// <summary>Implementation of the routine which gets the factory of the Entity type with the .NET type passed in</summary>
		/// <param name="typeOfEntity">The type of entity.</param>
		/// <returns>the entity factory of the entity type or null if not found</returns>
		protected override IEntityFactoryCore GetFactoryImpl(Type typeOfEntity)
		{
			return EntityFactoryFactory.GetFactory(typeOfEntity);
		}
#endif
	}
}
